home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
T-COMAL Today
/
(k)t2.d64
/
rotpac.l
< prev
next >
Wrap
Text File
|
2007-02-28
|
2KB
|
62 lines
9000 // ROTPAC WHICH CONTAINS
9010 //
9020 // ANGLET
9030 // DCTOEP
9040 // EPTODC
9050 //
9060 PROC ANGLET(REF A,REF AX,REF D(,)) CLOSED
9070 CA:=COS(A)
9080 SA:=SIN(A)
9090 I1:=(AX-1) MOD 3+1
9100 I2:=(AX) MOD 3+1
9110 I3:=(AX+1) MOD 3+1
9120 D(I1,I1):=1
9130 D(I1,I2):=0
9140 D(I1,I3):=0
9150 D(I2,I1):=0
9160 D(I2,I2):=CA
9170 D(I2,I3):=SA
9180 D(I3,I1):=0
9190 D(I3,I2):=-SA
9200 D(I3,I3):=CA
9210 ENDPROC ANGLET
9220 //
9230 PROC DCTOEP(REF D(,),REF EP()) CLOSED
9240 LIMIT:=1E-04
9250 TRD:=TRACE(D)
9260 SQT:=SQR(1+TRD)
9270 IF SQT<LIMIT THEN PRINT "EP(4) APPROX. ZERO",CHR$(13),CHR$(13)
9280 EP(4):=SQT
9290 E1:=D(2,3)-D(3,2)
9300 E2:=D(3,1)-D(1,3)
9310 E3:=D(1,2)-D(2,1)
9320 IF ABS(SQT)>.2 THEN
9330 EP(1):=E1/SQT
9340 EP(2):=E2/SQT
9350 EP(3):=E3/SQT
9360 ELSE
9370 EP(1):=SGN(E1)*SQR(ABS(2*D(1,1)+1-TRD))
9380 EP(2):=SGN(E2)*SQR(ABS(2*D(2,2)+1-TRD))
9390 EP(3):=SGN(E3)*SQR(ABS(2*D(3,3)+1-TRD))
9400 ENDIF
9410 E:=SQR(EP(1)^2+EP(2)^2+EP(3)^2+EP(4)^2)
9420 FOR I:=1 TO 4 DO
9430 EP(I):=2*EP(I)/E
9440 ENDFOR I
9450 ENDPROC DCTOEP
9460 //
9470 PROC EPTODC(REF EP(),REF D(,)) CLOSED
9480 E:=EP(4)
9490 E2:=E^2
9500 D(1,1):=.5*(EP(1)^2+E2)-1
9510 D(2,2):=.5*(EP(2)^2+E2)-1
9520 D(3,3):=.5*(EP(3)^2+E2)-1
9530 D(1,2):=.5*(EP(2)*EP(1)+EP(3)*E)
9540 D(1,3):=.5*(EP(3)*EP(1)-EP(2)*E)
9550 D(2,1):=.5*(EP(1)*EP(2)-EP(3)*E)
9560 D(2,3):=.5*(EP(3)*EP(2)+EP(1)*E)
9570 D(3,1):=.5*(EP(1)*EP(3)+EP(2)*E)
9580 D(3,2):=.5*(EP(2)*EP(3)-EP(1)*E)
9590 ENDPROC EPTODC
9600 //